<script type="text/javascript">

</script>

<h1>Dodaj - Kategoria</h1>

<form action="{url Category=Add}" method="post" enctype="multipart/form-data">
	<input type="hidden" id="AddCategory" name="AddCategory" value="1" />
	<div class="mainOptions">
		<h2 class="slidingTab"><a class="colapse" href="#">Ustawienia główne</a></h2>
		<table cellspacing="0" cellpadding="0" border="0" width="100%" class="commonTable">
		{assign var=descArray value=$obj->getAdminDescriptions()}
		{foreach from=$descArray item=desc}
		{assign var=langId value=$desc->getIdLanguage()}
		{assign var=lang value=$languages.$langId}
		{assign var=langCode value=$lang->getCode()}
			<tr>
				<th colspan="2"><strong>Język: {$lang->getName()}</strong></th>
			</tr>		
			<tr>
				<th><strong>Nazwa:</strong></th>
				<td>
					<input type="text" value="{$desc->GetName()}" id="{$langCode}_name" name="{$langCode}[name]"/>
					{if isset($error.$langCode.name)}<p class="validate">{$error.$langCode.name}</p>{/if}
				</td>
			</tr>
			<tr>
				<th><strong>Opis</strong></th>
				<td>
					<textarea id="{$langCode}_description" name="{$langCode}[description]">{$desc->GetName()}</textarea>
					{if isset($error.$langCode.name)}<p class="validate">{$error.$langCode.name}</p>{/if}
				</td>
			</tr>
			<tr>
				<th><strong>Słowa kluczowe</strong></th>
				<td>
					<textarea id="{$langCode}_description" name="{$langCode}[seo_keywords]">{$desc->GetName()}</textarea>
					{if isset($error.$langCode.seo_keywords)}<p class="validate">{$error.$langCode.seo_keywords}</p>{/if}
				</td>
			</tr>
			<tr>
				<th><strong>Opis meta</strong></th>
				<td>
					<textarea id="{$langCode}_description" name="{$langCode}[seo_description]">{$desc->GetName()}</textarea>
					{if isset($error.$langCode.seo_description)}<p class="validate">{$error.$langCode.seo_description}</p>{/if}
				</td>
			</tr>			
		{/foreach}
		</table>
	</div>
	<div class="mainOptions">
		<h2 class="slidingTab"><a class="colapse" href="#">Ustawienia dodatkowe</a></h2>
		<table cellspacing="0" cellpadding="0" border="0" width="100%" class="commonTable">
			<tr>
				<th><strong>Kategoria nadrzędna:</strong></th>
				<th>
					<select name="parent" id="parent">
						<option value="-1">(brak)</option>
						{foreach from=$mainCategories item=category}
						{assign var=description value=$category->GetCategoryDescription()}
						<option value="{$category->getId()}">{$description->getName()}</option>
						{/foreach}
					</select>
				</th>
			</tr>
			<tr>
				<th><strong>Url:</strong></th>
				<td>
					<input type="text" value="{$obj->GetSlug()}" id="slug" name="slug"/>
					{if isset($error.slug)}<p class="validate">{$error.slug}</p>{/if}
				</td>
			</tr>	
			<tr>
				<th><strong>Aktywny:</strong></th>
				<td>
					<input type="hidden" name="active" value="0" >
					<input type="checkbox" value="1" {if $obj->GetActive()}checked="checked"{/if} id="active" name="active"/>
					{if isset($error.active)}<p class="validate">{$error.active}</p>{/if}
				</td>
			</tr>	
			<tr>
				<td>Obraz:</td>
				<td><input type="file" name="image" /></td>
			</tr>
			{if strlen($obj->getImage()) gt 0}
			<tr>
				<td>Wgrany plik:</td>
				<td><img src="{$urlStatic}/{$obj->getImage()}" alt="" /><br />
				<input type="checkbox" name="removeimage" id="removeimage"/> <label for="removeimage">Usuń obraz</label></td>
			</tr>
			{/if}			
		</table>
	</div>	
	
	<p align="right"><input class="cancel" type="button" value="Anuluj" onclick="document.location.href='{url Category='Index'}'" /><input type="submit" value="Zapisz" /></p>
	
</form>

{*
<form action="{url Category=Add}" method="post" enctype="multipart/form-data">
	<input type="hidden" id="AddCategory" name="AddCategory" value="1" />
	<div class="mainOptions">
		<h2 class="slidingTab"><a class="colapse"  href="#"> Ogólne</a></h2>
		<div class="optionContent">
			<table cellspacing="0" cellpadding="0" border="0" width="100%" class="commonTable">
			<tr>
				<th><strong>Nazwa:</strong></th>
				<td>
					<input type="text" value="{$objCategory->GetName()}" id="name" name="name"/>
					{if isset($error.name)}<p class="validate">{$error.name}</p>{/if}
				</td>
			</tr>
			<tr>
				<th><strong>Opublikowany:</strong></th>
				<td >
					<input type="checkbox" {if $objCategory->GetStatus()}checked="checked"{/if} id="status" name="status"/>
					{if isset($error.status)}<p class="validate">{$error.status}</p>{/if}
				</td>
			</tr>
			<tr>
				<th><strong>Pozycja (waga):</strong></th>
				<td >
					<input type="text" value="{$objCategory->GetWeight()}" id="weight" name="weight"/>
					{if isset($error.weight)}<p class="validate">{$error.weight}</p>{/if}
				</td>
			</tr>
			</table>
		</div>
	</div>
	<div class="mainOptions">
		<h2 class="slidingTab"><a class="colapse" href="#">Preferencje</a></h2>
		<div class="optionContent">
			<table cellspacing="0" cellpadding="0" border="0" width="100%" class="commonTable">
				<tr>
					<th>Preferencje</th>
					<td>
						{foreach from=$preferenceObjs item=preferenceObj}
						<input type="checkbox" name="preferences[]" id="preference_{$preferenceObj->getId()}" value="{$preferenceObj->getId()}" />&nbsp;<label class="preferences" for="preference_{$preferenceObj->getId()}">{$preferenceObj->getName()} {if $preferenceObj->getStatus() eq 1}(+){else}(-){/if}</label>
						{/foreach}
						<br /><i>(+) - opublikowana, (-) - nieopublikowana</i>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<div class="mainOptions">
		<h2 class="slidingTab"><a class="colapse" href="#">Cechy Performera</a></h2>
		<div class="optionContent">
			<table cellspacing="0" cellpadding="0" border="0" width="100%" class="commonTable">
				<tr>
					<th>Cechy Performera</th>
					<td>
						{foreach from=$settingObjs item=settingObj}
						<input type="checkbox" name="settings[]" id="setting_{$settingObj->getId()}" value="{$settingObj->getId()}" />&nbsp;<label class="settings" for="setting_{$settingObj->getId()}">{$settingObj->getName()} {if $settingObj->getStatus() eq 1}(+){else}(-){/if}</label>
						{/foreach}
						<br /><i>(+) - opublikowana, (-) - nieopublikowana</i>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<div class="mainOptions">
		<h2 class="slidingTab"><a class="colapse"  href="#"> Opis</a></h2>
		<div class="optionContent">
		{if isset($objCategory)}
			{assign var='tresc' value=$objCategory->GetDescription()}
			{else}
			{assign var='tresc' value=''}
	    {/if}
	    {insertFckEditor width='620' height='380' id='tresc' name='description' toolbar='Formix' value=$tresc|stripslashes }
		{if isset($error.description)}<div style="color: red;" id="actionError">{$error.description}</div>{/if}

		</div>
	</div>

	


</form>
*}
